package dn.easy.common.constant;

import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Environment;

import dn.easy.common.bean.UserBean;

public class Contans {

    public static final String BaseUrl = "http://zzxx.xzlsedu.com:7023/study/page/mobile/";
    public static final String BASE_IMG_URL = "http://zzxx.xzlsedu.com:7023/study/upload/document/";
    public static final String BASE_DOWNLOAD_URL = "http://zzxx.xzlsedu.com:7023/upload/document/";

    public final static String PDFLOCATION = Environment.getExternalStorageDirectory() + "/" + "teacher";//本地地址
    public final static String PHONE_NUMBER = "PHONE";
    public final static String USERNAME = "USERNAME";
    public final static String PSW = "PSW";
    public final static String SSESSIONID = "sessionid";
    public final static String USERID = "userid";
    public static final String TOKEN = "";
    /**
     * 登陆user
     */
    public static final String USERBEAN = "userbean";

    public final static int getVersion(Context context) {
        PackageManager manager = context.getPackageManager();
        int code = 0;
        try {
            PackageInfo info = manager.getPackageInfo(context.getPackageName(), 0);
            code = info.versionCode;
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }
        return code;
    }

    public static UserBean user = null;

}
